import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import java.awt.Color;
import java.awt.Font;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;


public class HuongDan extends JFrame {

	private JPanel contentPane;
	static PlayGame play;
	static HuongDan frame;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					frame = new HuongDan();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public HuongDan() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 700, 500);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblHngDn = new JLabel("HƯỚNG DẪN");
		lblHngDn.setFont(new Font("Tahoma", Font.PLAIN, 25));
		lblHngDn.setForeground(Color.RED);
		lblHngDn.setHorizontalAlignment(SwingConstants.CENTER);
		lblHngDn.setBounds(197, 11, 279, 41);
		contentPane.add(lblHngDn);
		
		JButton btnChi = new JButton("CHƠI");
		btnChi.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				play = new PlayGame();
				play.setVisible(true);
				play.setResizable(false);
				frame.setVisible(false);
				
			}
		});
		btnChi.setBounds(249, 324, 180, 52);
		contentPane.add(btnChi);
		
		JLabel lblNewLabel = new JLabel("Trước tiên chọn loại gia cầm bằng cách:");
		lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
		lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 13));
		lblNewLabel.setBounds(10, 51, 652, 32);
		contentPane.add(lblNewLabel);
		
		JLabel label = new JLabel();
		try {
			BufferedImage trung=ImageIO.read(new File("src\\Images\\ga.png"));
			ImageIcon ictrung=new ImageIcon(trung.getScaledInstance(30,30, trung.SCALE_SMOOTH));
			label.setIcon(ictrung);
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		label.setBounds(251, 81, 52, 41);
		label.setSize(30,30);
		contentPane.add(label);
		
		JLabel lblNhnG = new JLabel("Nhấn g để ");
		lblNhnG.setFont(new Font("Tahoma", Font.PLAIN, 13));
		lblNhnG.setBounds(186, 81, 68, 23);
		contentPane.add(lblNhnG);
		
		JLabel lblGXutHin = new JLabel("gà xuất hiện và chạy bên trên");
		lblGXutHin.setFont(new Font("Tahoma", Font.PLAIN, 13));
		lblGXutHin.setBounds(289, 81, 187, 23);
		contentPane.add(lblGXutHin);
		
		JLabel lblNhnV = new JLabel("Nhấn v để ");
		lblNhnV.setFont(new Font("Tahoma", Font.PLAIN, 13));
		lblNhnV.setBounds(186, 113, 68, 23);
		contentPane.add(lblNhnV);
		
		JLabel label1 = new JLabel();
		try {
			BufferedImage trung=ImageIO.read(new File("src\\Images\\vit.png"));
			ImageIcon ictrung=new ImageIcon(trung.getScaledInstance(30,30, trung.SCALE_SMOOTH));
			label1.setIcon(ictrung);
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		label1.setBounds(251, 106, 52, 41);
		label1.setSize(30,30);
		contentPane.add(label1);
		
		JLabel lblVtXutHin = new JLabel("vịt xuất hiện và chạy bên trên");
		lblVtXutHin.setFont(new Font("Tahoma", Font.PLAIN, 13));
		lblVtXutHin.setBounds(289, 113, 187, 23);
		contentPane.add(lblVtXutHin);
		
		JLabel lblNhnN = new JLabel("Nhấn n để ");
		lblNhnN.setFont(new Font("Tahoma", Font.PLAIN, 13));
		lblNhnN.setBounds(186, 147, 68, 23);
		contentPane.add(lblNhnN);
		
		JLabel label2 = new JLabel();
		try {
			BufferedImage trung=ImageIO.read(new File("src\\Images\\ngan.png"));
			ImageIcon ictrung=new ImageIcon(trung.getScaledInstance(30,30, trung.SCALE_SMOOTH));
			label2.setIcon(ictrung);
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		label2.setBounds(251, 140, 52, 41);
		label2.setSize(30,30);
		contentPane.add(label2);
		
		JLabel lblNganXutHin = new JLabel("ngan xuất hiện và chạy bên trên");
		lblNganXutHin.setFont(new Font("Tahoma", Font.PLAIN, 13));
		lblNganXutHin.setBounds(289, 147, 187, 23);
		contentPane.add(lblNganXutHin);
		
		JLabel lblTrongLcGia = new JLabel("Trong lúc gia cầm di chuyển bên trên chúng sẽ ngẫu nhiên sinh ra           hoặc ");
		lblTrongLcGia.setHorizontalAlignment(SwingConstants.CENTER);
		lblTrongLcGia.setFont(new Font("Tahoma", Font.PLAIN, 13));
		lblTrongLcGia.setBounds(10, 181, 652, 23);
		contentPane.add(lblTrongLcGia);
		
		JLabel lbltr = new JLabel();
		try {
			BufferedImage trung=ImageIO.read(new File("src\\Images\\egg.png"));
			ImageIcon ictrung=new ImageIcon(trung.getScaledInstance(30,30, trung.SCALE_SMOOTH));
			lbltr.setIcon(ictrung);
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		lbltr.setBounds(494, 169, 30, 30);		
		contentPane.add(lbltr);
		
		JLabel lblshit = new JLabel();
		try {
			BufferedImage sh=ImageIO.read(new File("src\\Images\\shit.png"));
			ImageIcon ictrung=new ImageIcon(sh.getScaledInstance(30,30, sh.SCALE_SMOOTH));
			lblshit.setIcon(ictrung);
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		lblshit.setBounds(565, 169, 30, 30);		
		contentPane.add(lblshit);
		
		JLabel lblnTrngTrng = new JLabel("Ăn trúng Trứng sẽ được cộng điểm. Mỗi 20 quả thì tốc độ của trò choi sẽ tăng lên.");
		lblnTrngTrng.setHorizontalAlignment(SwingConstants.CENTER);
		lblnTrngTrng.setFont(new Font("Tahoma", Font.PLAIN, 13));
		lblnTrngTrng.setBounds(10, 208, 652, 32);
		contentPane.add(lblnTrngTrng);
		
		JLabel lblNunTrng = new JLabel(" Nếu ăn trúng 3 cục shit trò chơi sẽ kết thúc.");
		lblNunTrng.setHorizontalAlignment(SwingConstants.CENTER);
		lblNunTrng.setFont(new Font("Tahoma", Font.PLAIN, 13));
		lblNunTrng.setBounds(10, 242, 652, 23);
		contentPane.add(lblNunTrng);
		
		
		
	}
}
